﻿namespace Modbus.Messages
{
	internal class StartingAddressQuantityMessage : ModbusMessage
	{
		private ushort startingAddress;
		private ushort quantity;

		public override void Read(ModbusReader reader)
		{
			base.Read(reader);

			this.startingAddress = reader.ReadUInt16();
			this.quantity = reader.ReadUInt16();
		}

		public override void Write(ModbusWriter writer)
		{
			base.Write(writer);

			writer.Write(this.startingAddress);
			writer.Write(this.quantity);
		}

		public ushort StartingAddress
		{
			get { return this.startingAddress; }
			set { this.startingAddress = value; }
		}

		public ushort Quantity
		{
			get { return this.quantity; }
			set { this.quantity = value; }
		}
	}
}
